package com.ibm.workplace.wcm.cqplugin.ui.preference;

import org.eclipse.jface.preference.*;
import org.eclipse.jface.resource.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.*;

import com.ibm.workplace.wcm.cqplugin.*;

public class AdvancedPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage {

    private AdvancedPreferencesComposite composite;
  
   public AdvancedPreferencesPage() {
        super();
    }

    public AdvancedPreferencesPage(String arg0, ImageDescriptor arg1) {
        super(arg0, arg1);
    }

    public AdvancedPreferencesPage(String arg0) {
        super(arg0);
    }

    public void init(IWorkbench arg0) {

    }    

    protected Control createContents(Composite arg0) {
        composite = new AdvancedPreferencesComposite(arg0, 0);
        composite.init(getPreferenceStore(), false);
        
        return composite;
    }

    protected void performApply() {
        composite.store(getPreferenceStore());
        
        super.performApply();
    }

    public boolean performOk() {
        composite.store(getPreferenceStore());
        
        return super.performOk();
    }

    protected IPreferenceStore doGetPreferenceStore()
    {
        return Activator.getDefault().getPreferenceStore();
    }

    protected void performDefaults() {
        composite.init(getPreferenceStore(), true);
    }

}
